package com.polytech.business;

import java.util.Collection;

import com.polytech.beans.Booking;
import com.polytech.beans.Car;
import com.polytech.dao.BookingDao;

public class DefaultReservationManager implements ReservationManager {

	private BookingDao bookingDao;
	@Override
	public void create(Booking booking) {
		System.out.println("BookingDao.create");
		bookingDao.insert(booking);
	}

	@Override
	public Booking find(String key) {
		return bookingDao.select(key);
	}

	@Override
	public void remove(Booking booking) {
		bookingDao.remove(booking);
	}

	@Override
	public void update(Booking booking) {
		bookingDao.insert(booking);
		
	}

	public void setBookingDao(BookingDao bookingDao) {
		this.bookingDao = bookingDao;
	}


	@Override
	public Collection<Car> getBookedCars() {
		return bookingDao.selecetBookedCars();
	}

	@Override
	public Collection<Car> getNonBookedCars() {
		return bookingDao.selecetNonBookedCars();
	}
	
}
